// File: grid.h
// Author: Ilkka Vuorio

// Description: Header for class Grid.

#ifndef GRID_H
#define GRID_H

#include <vector>

using namespace std;

class Cell;
class Domain;

class Grid
{
public:
    // This is the unit test.
    // First it creates a Grid object grid.
    // Then it calls all the methods of grid 
    // and checks that they behave as expected.
    // Returns true if everything works OK, false otherwise.
    static bool runUnitTest();

    Grid();
    ~Grid();

    // How many cells in the grid are solved (have values)
    int getSolvedCellCount() const;

	int deleteCandidatesByValue();

	// Scans all cells. If a cell has only 1 candidate, that
	// candidate is promoted to value. Return value is number of promoted cells
	int promoteSingleCandidates();
private:
    vector<Cell*> m_cells;
    vector<Domain*> m_rows;
    vector<Domain*> m_columns;
    vector<Domain*> m_boxes;
};

#endif